<?php

/**
 * abuse for post
 */
$this->widget('bootstrap.widgets.TbGridView', array(
    'id' => 'post-grid',
    'dataProvider' => $model->search(Abuse::POST_TYPE),
    'filter' => $model,
    'columns' => array(
	array(
	    'name' => 'postTitle',
	    'value' => '$data->posts->title'
	),
	array(
	    'name' => 'sender',
	    'value' => '$data->user->username'
	),
	array(
	    'name' => 'message',
	    'filter' => $aStatementAbuse,
	),
	array(
	    'name' => "link_post",
	    'type' => 'raw',
	    'value' => function($data) {
		return "<a href='" . $data->link_post . "' target='_blank'>Link</a>";
	    },
	    'filter' => false
	),
	array(
	    'name' => 'time_created',
	    'type' => 'raw',
	    'value' => function($data) {
		return date('m-d-Y', $data->time_created);
	    },
	    'filter' => false
	),
	array(
	    'type' => 'raw',
	    'value' => function($data) {
		return $data->getIgnoreUrl();
	    }
	),
	array(
	    'class' => 'bootstrap.widgets.TbButtonColumn',
	    'template' => '{delete}',
	    'buttons' => array(
		'delete' => array(
		    'url' => 'Yii::app()->controller->createUrl("post/deletereportabuse", array("id"=>$data->abuse_id,"type"=>$data->type,"item_id"=>$data->item_id))',
		),
	    ),
	)
    ),
));
